
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../pages.dart';

class FrontNavigationBarPageLogic extends GetxController {
  int selectedIndex = 0;

  List<Widget> pages = [
    FrontPage(),
    MyMessagesPage(),
    Mypage(),
  ];

  void onItemTapped(int index) {
    selectedIndex = index;
    update();
  }
  Widget BottomBar(){
    return BottomNavigationBar(
      items: [
        BottomNavigationBarItem(
          icon:  Icon(Icons.home),
          label: "首页",
        ),
        BottomNavigationBarItem(
          icon:  Icon(Icons.message),
          label: "消息",
        ),
        BottomNavigationBarItem(
          icon:  Icon(Icons.person),
          label: "我的",
        ),
      ],
      currentIndex: selectedIndex,
      selectedItemColor: Colors.blue,
      onTap:onItemTapped,
    );
  }



}


class MyMessagesPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Text(
        'Messages Page',
        style: TextStyle(fontSize: 32),
      ),
    );
  }
}

